package com.zte.springboot_smbms.service.impl;


import com.zte.springboot_smbms.mapper.SmbmsProviderMapper;
import com.zte.springboot_smbms.pojo.SmbmsProvider;
import com.zte.springboot_smbms.service.ProvidersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ProvidersServiceImpl implements ProvidersService {
    @Autowired
    private SmbmsProviderMapper smbmsProviderMapper;
    @Override
    @Transactional(readOnly = true)
    public List<SmbmsProvider> findAllProvider() {
        return smbmsProviderMapper.findAllProvider();
    }

    @Override
    @Transactional(readOnly = true)
    public List<SmbmsProvider> findProviderById(Long id) {
        return smbmsProviderMapper.findProviderById(id);
    }

    @Override
    @Transactional(readOnly = false)
    public boolean addProvider(SmbmsProvider provider) {
        return smbmsProviderMapper.addProvider(provider);
    }

    @Override
    @Transactional(readOnly = false)
    public boolean delProvider(Long id) {
        return smbmsProviderMapper.delProvider(id);
    }

    @Override
    @Transactional(readOnly = false)
    public boolean updateProvider(Long id, SmbmsProvider provider) {
        return smbmsProviderMapper.updateProvider(id,provider);
    }

    @Override
    @Transactional(readOnly = true)
    public List<SmbmsProvider> findProviderByParam(String queryProCode, String queryProName) {
        return smbmsProviderMapper.findProviderByParam(queryProCode,queryProName);
    }
}
